package api.list.practice01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class IntegerDemo {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Random random =new Random();
        for (int i = 0; i <6 ; i++) {
            list.add(i, random.nextInt(10));
        }
        System.out.println(list);

        System.out.println("排序后");
        Collections.sort(list);
        System.out.println(list);

        System.out.println("降序排列");
        Collections.reverse(list);
        System.out.println(list);


    }
}
